package com.fmx.BookStore.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fmx.BookStore.domain.RolePermission;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface RolePermissionMapper extends BaseMapper<RolePermission> {
    @Delete("delete from role_permission where role_id = #{roleId}")
    int deleteByRoleId(@Param("roleId") Long roleId);

    @Select("select permission_id from role_permission where role_id = #{roleId}")
    List<Long> selectByRoleId(@Param("roleId")Long roleId);
}
